package com.ltmall.api.manager;

import com.ltmall.api.bean.*;
import com.ltmall.api.util.PageUtil;

import java.util.List;

public interface AccountManager {
    //添加用户账号
    public boolean addClientAccount(ClientAccount account);

    //判断手机号是否已经被使用
    public boolean isPhoneUsed(String phone);

    //判断用户是否已存在,返回用户userid
    public int isHaveAccount(String openid);

    //添加个人信息和配置
    public void initConfigAndInfo(ClientConfig config, ClientInfo info);

    //手机号登陆
    public boolean phoneLogin(String phone, String pass);

    //修改token
    public boolean updateToken(int userID, String token);

    //获取个人配置
    public ClientConfig getConfig(int userID);

    //获取个人帐号
    public ClientAccount getAccount(String phone, int userID);

    //获取个人信息
    public ClientInfo getInfo(int userID);

    //更新个人信息
    public boolean updateInfo(int userID, String name, int sex);

    //更新等级
    public boolean updateLevel(int userId, int levelId);

    //身份验证
    public boolean validate(int userID, String userToken);

    //修改个人头像
    public boolean updatePhoto(int userID, String photo);

    // 添加收获地址
    public boolean addDelevery(DeliveryAddr addr);

    // 修改收获地址
    public boolean updateDelevery(int addrID, int userID, String name, String phone,
                                  String address, String province, String city, String county,
                                  int isDefault);

    // 删除收获地址
    public boolean deleDelivery(int addrID);

    // 获取收货地址
    public List<DeliveryAddr> getDelivery(int userID, int number);

    //修改密码
    public boolean updatePass(int userID, String pass);

    //添加商家信息
    public boolean addBussinessInfo(BussinessInfo bInfo);

    //添加商家账号
    public void addBussinessAccount(BussinessAccount bAccount);

    //获取用户收货地址
    public DeliveryAddr getAddr(int addrID);

    //收藏
    public boolean collection(Collection collection);

    //收藏列表
    public List<?> collectionList(int userID, PageUtil page);

    //	//取消收藏
    //	public boolean cancelCollection(int collectionID,int userID);

    //修改籍贯
    public boolean editHome(int userID, String province, String city, String county);

    //添加反馈
    public boolean addFeedback(Feedback feedback);

    // 检测用户是否存在
    public ThClientPlatforms checkUserExistByOpenID(String opendID);

    // 创建平台账户
    public void addClientPlatform(ThClientPlatforms platform);

    // 获取平台账户
    public ThClientPlatforms getClientPlatformByUserId(int userId);

    // 获取平台账户
    public ThClientPlatforms getClientPlatformByOpenId(String openId);

    //获取等级信息
    public ThUserLevels userLevelGet(int levelId);

    public boolean updateClientAccount(ClientAccount account);
    
    public boolean editDirectSupplyId(int userID, String directSupplyId);

}
